package com.fengchao.dao;

import com.fengchao.model.OdrOrderPayment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * Created by http://my.oschina.net/wangnian on 2016/7/20.
 */
@Mapper
public interface OdrOrderPaymentMapper {

    @Insert("insert into odr_order_payment(order_id,order_sn,pay_channel,pay_money,pay_account,pay_transaction_number,pay_status,pay_time,create_time) VALUES(#{orderId},#{orderSn},#{payChannel},#{payMoney},#{payAccount},#{payTransactionNumber},#{payStatus},#{payTime},#{createTime})")
    Integer insert(OdrOrderPayment odrOrderPayment);

    @Select("select * from odr_order_payment where order_id=#{orderId} and pay_status='SUCCESS'")
    OdrOrderPayment findByOrderIdAndPayStatus(Integer orderId);

}
